package wili.b1;

import java.io.File;
import java.util.List;

import wili.c.Ca;

/**
 * @2022/9/2 weilai
 */
class InsertIncNumToFile9 {
	static String chgList = "ch1814400";
	static int[] INC = { 1 };
	static final String MARK = "`", MARK2 = ";" + MARK + ";";

	static void insertIncNum_to_all_propertiesFile(boolean insert, String reg, String replace) {
		List<File> files = InsertIncNumToFile9a.getPropertiesFiles();
		int allNum = 0, updateNum = 0;
		for (int i = 0; i < files.size(); i++) {
			File file = files.get(i);
			++allNum;
			if (InsertIncNumToFile9a.insertIncNum_to_file(insert, file, reg, replace)) {
				++updateNum;
			}
		}
	}

	static void insertIncNum_to_all_xmlFile(boolean insert, String reg, String replace) {
		/*
		<description>Document Total (FC)</description>
		<table:description>Document Total</table:description>
		<itemName>Document Total</itemName>
		<title>Document Total (LC)</title>
		 */
	}

	static int allNum = 0, updateNum = 0;

	static String insertIncNum_to_all_jsonFile(boolean insert, String regexp, String replace) {
		//"text": "{i18n>grid-col-distribution-rule}"
		List<File> jsonDirs = InsertIncNumToFile9a.getJsonFiles();
		for (int i = 0; i < jsonDirs.size(); i++) {
			File file = jsonDirs.get(i);
			if (file.getName().equals("VOIGNP.detailView.json"))
				Ca.pause();
			++allNum;
			if (InsertIncNumToFile9a.insertIncNum_to_file(insert, file, regexp, replace)) {
				++updateNum;
			}
		}
		return "";
	}

	static String r(String st) {
		return st.replaceFirst("`", MARK);
	}
}
